package web.model.util;

import org.springframework.beans.BeanUtils;

/**
 * Created by cjwfuture on 2021/6/2
 */
public class ModelUtils {

    @lombok.SneakyThrows
    public static <T> T copy(Object obj, Class<T> clazz) {
        T newObj = clazz.newInstance();
        BeanUtils.copyProperties(obj, newObj);
        return newObj;
    }
}
